﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Javascript操作剪贴板</title>
  <script type="text/javascript" language="JavaScript">
    function windowCopy(){
      window.clipboardData.setData("Text",txt1.innerText);
    }
    function windowParse(){
      let txt= window.clipboardData.getData("Text");
      txt1.innerText=txt+"粘贴完毕"
    }
    
  </script>
</head>
<body>
<textarea cols=30 rows=10 id="txt1">
</textarea>
<table id="mytbl" width="300" height="50" border="0" cellspacing="2" cellpadding="0" bgcolor="#FFb609">
  <tr>
    <td> <input id="btnOne" type="button" value="window剪贴板-剪切" 
                onclick="windowCopy()" /></td>
    <td> <input id="btnTwo" type="button" value="window剪贴板-粘贴" 
                onclick="windowParse()" /></td>
  </tr>
</table>
</body>
</html>